<?
 class ControllerException extends Exception {
    function display() {
        echo 'UserException: ' . $this->getMessage() . "\n";
    }
    
    function getLocation() {
    	
    	if($this->getMessage() === 'not_logged_admin')
    		return '/admin/login/?return='.$_SERVER[REQUEST_URI];

		if($this->getMessage() === 'not_logged_user')
			return '/login/?redirect='.$_SERVER[REQUEST_URI];
    		
    	if($this->getMessage() === 'access_denied')
    		return '/admin/error?denied';
    		
    	if($this->getMessage() === 'exists_alias')
    		return '/admin/error?exists=alias';
    		
    }
 }

?>